import {createRouter, createWebHistory} from "vue-router";
import Test from "@/views/RichText.vue";


const router = createRouter({
    history: createWebHistory(import.meta.env.BASE_URL),
    routes: [
        {
            path: '/test',
            name: 'test',
            component: Test
        },
        {
            path: '/',
            name: 'home',
            redirect: '/index',
            component: () => import('@/layout/Layout.vue'),
            children: [
                {
                    path: '/index',
                    name: 'index',
                    component: () => import('@/views/ArticleList.vue')
                },
                {
                    path: '/rt',
                    name: 'rt',
                    component: () => import('@/views/RichText.vue')
                },
                {
                    path: '/info',
                    name: 'info',
                    component: () => import('@/views/UserInfo.vue')
                },{
                    path: '/article',
                    name: 'article',
                    component: () => import('@/views/ArticleInfo.vue')
                },{
                    path: '/work',
                    name: 'workbench',
                    component: () => import('@/views/MyArticle.vue')
                }
                ]
        },
        {
            path: '/login',
            name: 'login',
            component: () => import('@/views/Login.vue')
        },
        {
            path: '/register',
            name: 'register',
            component: () => import('@/views/Register.vue')
        },
    ]
})

export default router
